@extends('admin.base.index')
@section('content')
<div class="block-area" id="tableStriped">
                    <h3 class="block-title">商品列表主页</h3>
                    <form action="" method="post" name="myform">
				    	<input type="hidden" name="_token" value="{{ csrf_token() }}">
				    	<input type="hidden" name="_method" value="DELETE">
				    </form>
                    <div class="table-responsive overflow">
                        <table class="tile table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <td align="center">商品id</td>
                                    <td align="center">小标题</td>
                                    <td align="center">图片</td>
                                    <td align="center">名称</td>
                                    <td align="center">路径</td>
                                    <td align="center">简介</td>
                                    <td align="center">价格</td>
                                    <td align="center">优惠价格</td>
                                    <td align="center">库存</td>
                                    <td align="center">改变后库存</td>
                                    <td align="center">是否推荐</td>
                                    <td align="center">上架下架</td>
                                    <td align="center">操作</td>
                                </tr>
                            </thead>
                            <tbody>
                            @foreach($list as $v)
                                <tr>
                                    <td align="center">{{ $v->goodsid }}</td>
                                    <td align="center">{{ $v->subtitle }}</td>
                                    <td align="center">{{ $v->picture }}</td>
                                    <td align="center">{{ $v->goodsname }}</td>
                                    <td align="center">{{ $v->path }}</td>
                                    <td align="center">{{ $v->intro }}</td>
                                    <td align="center">{{ $v->price }}</td>
                                    <td align="center">{{ $v->preferential }}</td>
                                    <td align="center">{{ $v->stock }}</td>
                                    <td align="center">{{ $v->varstock }}</td>
                                    <td align="center">{{ ($v->recommend)==0?'推荐':'不推荐' }}</td>
                                    <td align="center">{{ ($v->status)==0?'上架':'下架' }}</td>
                                    <td align="center">
                    					<a href="javascript:doDel({{ $v->goodsid }})">
                    						<button class="btn-info">删除</button>
                    					</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    					<a href="/admin/goods/{{ $v->goodsid }}/edit">
                    						<button class="btn-info">修改</button>
                    					</a>
                   			 		</td>
                                </tr>
                             @endforeach
                            </tbody>
                        </table>
                        <script type="text/javascript">
				        	function doDel(id)
				        	{
				        		if(confirm('确定要删除吗???')){
				        			var form = document.myform;
				        			form.action = '/admin/goods/'+id;
				        			form.submit();
				        		}
				        	}
       					</script>
                    </div>
                </div>
@stop
